package com.soarsky.boteng;
import cn.sccl.common.util.StringUtil;
/**
 * 转换成小写,如果有“_”则串一小写串二(默认小写)可自定义
 * @author 鲜虎
 *
 */
public class UnderlineSplitWordsParser implements WordsParser {

	public String parseWords(String orginalString) {
		String[] items = orginalString.split(StringUtil.UNDER_LINE);
		String result = "";
		for (int i = 0; i < items.length; i++) {
			items[i] = items[i].toLowerCase();
			if (i > 0) {
				result = result +StringUtil.UNDER_LINE+items[i];
			} else {
				result = result + items[i];
			}
		}
		return result;
	}

}
